<?php

namespace app\factory\controller;

use app\common\respond\HttpApi;
use app\factory\logic\FourteenFeedPlanLogic;

class FourteenFeedPlanController
{
    /**
     * @Description 新增/编辑
     * @author: zj
     * @param HttpApi $respond
     * @time 2024/03/18 14:05:42
     * @return \think\response\Json
     */
    public function addEdit(HttpApi $respond)
    {
        $param = [
            "Id" => request()->post('Id'),
            "Name" => request()->post('Name'),
            "DayId" => request()->post('DayId'),
            "isLoop" => request()->post('isLoop'),
            "Remark" => request()->post('Remark'),
            "RecordTime" => request()->post('RecordTime'),
        ];
        $rule = [
            "Id" => "require|integer|>:0",
            "Remark" => "max:255",
            "RecordTime" => "require|integer|>:0",
        ];
        validate($rule)->check($param);

        $logic = new FourteenFeedPlanLogic();
        $data = $logic->addEdit($param['Id'],$param);

        return $respond->success([]);
    }

}